<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Add User'); ?></div>
    <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <form action="" method="post" id="frmUser">
    	<div class="element">
            <label>Username <span class="red">*</span></label>
            <input type="text" name="user[user_username]" id="title" class="text required" value="<?php echo isset($arrItemInfo['user_username'])?$arrItemInfo['user_username']:null; ?>">
        </div>
        <div class="element">
            <label>Email <span class="red">*</span></label>
            <input type="text" name="user[user_email]" id="title" class="text required email" value="<?php echo isset($arrItemInfo['user_email'])?$arrItemInfo['user_email']:null; ?>">
        </div>
        <div class="element">
            <label>Full name <span class="red">*</span></label>
            <input type="text" name="user[user_fullname]" id="title" class="text required" value="<?php echo isset($arrItemInfo['user_fullname'])?$arrItemInfo['user_fullname']:null; ?>">
        </div>
        <div class="element">
            <label>Password <span class="red">*</span></label>
            <input type="password" name="user[user_password]" id="title" class="text" value="">
        </div>
        <div class="element">
            <label>Re-Password <span class="red">*</span></label>
            <input type="password" name="repassword" id="title" class="text" value="">
        </div>
        <div class="element">
            <label>Roles <span class="red">*</span></label>
            <div style="max-height: 200px; min-height: 42px; overflow: auto;">
                <ul style="list-style-type:none;">
                <?php foreach($arrRoles as $R): ?>
                	<li>
                        <input type="checkbox" name="roles[]" value="<?php echo $R['role_id']; ?>" <?php if(isset($arrItemInfo['roles']) && in_array($R['role_id'], $arrItemInfo['roles'])): ?>checked<?php endif; ?>> 
                        <?php echo $R['role_name'].'<br>'; ?>
                 	</li>
				 <?php endforeach; ?>
                 </ul>
             </div>
            <!--
            <select name="roles[]" multiple>
                <?php foreach($arrRoles as $R): ?>
                <option value="<?php echo $R['role_id']; ?>" <?php if(isset($arrItemInfo['roles']) && in_array($R['role_id'], $arrItemInfo['roles'])): ?>selected<?php endif; ?>>
					<?php echo $R['role_name']; ?>
                </option>
                <?php endforeach; ?>
            </select>
            -->
        </div>
        <div class="entry">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['user_id'])?$arrItemInfo['user_id']:null; ?>">
            <button type="submit">Submit</button> <button>Cancel</button>
        </div>
    </form>
</div>
<script type="text/javascript">
	$(function(){
		$('#frmUser').validate();
	});
</script>